package com.qf.mapper;

import com.qf.pojo.SysScene;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * created by 赵文韬 on 2022/3/21 21:21
 */
public interface SysSceneMapper {
    @Insert("insert into sys_scene(scene_name,create_by,create_time)values (#{sceneName},#{createBy},#{createTime})")
    void addSysScene(SysScene sysScene);
    @Select("SELECT * FROM sys_scene WHERE create_by=#{userId} AND scene_name=#{scenceName}")
    SysScene findByUserAndName(@Param("userId") Long userId,@Param("scenceName")  String scenceName);
    @Update("update sys_scene set status=#{status} where scene_id=#{status}")
    int updateSysScene(@Param("sceneId") Long sceneId,@Param("status") Long status);
    @Select("select * from sys_scene where scene_id=#{id}")
    SysScene findById(Long id);
}
